// This example shows how to let the user browse for multiple OPC-UA nodes. // // Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html . using System.Windows.Forms; using OpcLabs.EasyOpc.UA.Forms.Browsing; namespace UAFormsDocExamples._UABrowseDialog { static partial class ShowDialog { public static void MultiSelect(IWin32Window owner) { var browseDialog = new UABrowseDialog(); browseDialog.InputsOutputs.CurrentNodeDescriptor.EndpointDescriptor.Host = "opcua.demo-this.com"; browseDialog.Mode.AnchorElementType = UAElementType.Host; browseDialog.Mode.MultiSelect = true; DialogResult dialogResult = browseDialog.ShowDialog(owner); if (dialogResult != DialogResult.OK) return; // Display results UABrowseNodeElementCollection selectionElements = browseDialog.Outputs.SelectionElements; string text = ""; for (int i = 0; i < selectionElements.Count; i++) { UABrowseNodeElement selectionElement = selectionElements[i]; text += $"SelectionElements({i}): {selectionElement.NodeElement}\r\n"; } MessageBox.Show(owner, text); } } }
# This example shows how to let the user browse for an OPC-UA node. # # Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html . # OPC client and subscriber examples in Python on GitHub: https://github.com/OPCLabs/Examples-QuickOPC-Python . # The QuickOPC package is needed. Install it using "pip install opclabs_quickopc". import opclabs_quickopc # Import .NET namespaces. from System.Windows.Forms import * from OpcLabs.EasyOpc.UA.Forms.Browsing import * browseDialog = UABrowseDialog() browseDialog.InputsOutputs.CurrentNodeDescriptor.EndpointDescriptor.Host = 'opcua.demo-this.com' browseDialog.Mode.AnchorElementType = UAElementType.Host dialogResult = browseDialog.ShowDialog() print(dialogResult) if dialogResult != DialogResult.OK: exit() # Display results. print(browseDialog.Outputs.CurrentNodeElement.NodeElement) print('Finished.')
' This example shows how to let the user browse for an OPC-UA node. ' ' Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html . Imports OpcLabs.EasyOpc.UA.Forms.Browsing Namespace UAFormsDocExamples._UABrowseDialog Friend Class ShowDialog Shared Sub Main1(owner As IWin32Window) Dim browseDialog = New UABrowseDialog() browseDialog.InputsOutputs.CurrentNodeDescriptor.EndpointDescriptor.Host = "opcua.demo-this.com" browseDialog.Mode.AnchorElementType = UAElementType.Host Dim dialogResult As DialogResult = browseDialog.ShowDialog(owner) If dialogResult <> DialogResult.OK Then Return End If ' Display results MessageBox.Show(owner, browseDialog.Outputs.CurrentNodeElement.NodeElement.ToString()) End Sub End Class End Namespace
Rem This example shows how to let the user browse for multiple OPC-UA nodes. Rem Rem Find all latest examples here : https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html . Option Explicit Const DialogResult_OK = 1 Const UAElementType_Host = 1 Dim BrowseDialog: Set BrowseDialog = CreateObject("OpcLabs.EasyOpc.UA.Forms.Browsing.UABrowseDialog") BrowseDialog.InputsOutputs.CurrentNodeDescriptor.EndpointDescriptor.Host = "opcua.demo-this.com" BrowseDialog.Mode.AnchorElementType = UAElementType_Host BrowseDialog.Mode.MultiSelect = True Dim dialogResult: dialogResult = BrowseDialog.ShowDialog WScript.Echo dialogResult If dialogResult <> DialogResult_OK Then WScript.Quit End If ' Display results Dim SelectionElements: Set SelectionElements = BrowseDialog.Outputs.SelectionElements Dim i: For i = 0 To SelectionElements.Count - 1 Dim Element: Set Element = SelectionElements(i) WScript.Echo "SelectionElements(" & i & "): " & Element.NodeElement Next
Copyright © 2004-2024 CODE Consulting and Development, s.r.o., Plzen. All rights reserved.
Send Documentation Feedback. Technical Support